<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.js"></script>
</head>
<body>
    <script>
    function http(url,callback){
        $.ajax({
            url,
            dataType:"jsonp",
            success:function(res){
                callback(res);
            }
        })
    }
    // var handleData=function(res){
    //     console.log(res);
    // }
    // http(url,handleData)
    var url="http://api.douban.com/v2/movie/in_theaters";
    http(url,function(res){
        console.log(res);
    });//es5
    http(url,res=>{
        console.log(res);
    })//es6
    </script>
</body>
</html>